package com.shop.local;

import com.shop.dto.UserInfo;

/**
 * @author wzby
 * @Date: 2022/10/30 15:22
 */
public class UserInfoLocal {
    private static ThreadLocal<UserInfo> userInfoThreadLocal = new InheritableThreadLocal<>();

    public static void set(UserInfo userInfo){
        userInfoThreadLocal.set(userInfo);
    }

    public static UserInfo get(){
        return userInfoThreadLocal.get();
    }
}
